Function Reference

_GUICtrlStatusBarSetText

Sets the text in the specified part of a status window.

#Include <GuiStatusBar.au3>
_GUICtrlStatusBarSetText ( $h_StatusBar [, $s_Data = "" [, $i_Part = 0 ]] )

 

Parameters

$h_StatusBar The Control Id (will be converted to hWnd)
$s_Data The text to display in the part
$i_Part Optional: The part to hold the text (Default: 0)

 

Return Value

Returns TRUE if successful, or FALSE otherwise.

 

Remarks

In Microsoft Windows XP and earlier, the text for each part is limited to 127 characters.

Status text align: left/center/right

By default, text is left-aligned within the specified part of a status bar.
You can embed tab characters (@TAB) in the text to center or right-align it.
Text to the right of a single tab character is centered,
and text to the right of a second tab character is right-aligned.

 

Related

_GUICtrlStatusBarCreate, _GUICtrlStatusBarGetText

 

Example


Opt("MustDeclareVars", 1)

#include <GUIConstants.au3>
#Include <GuiStatusBar.au3>

Local $gui, $StatusBar1, $msg
Local $a_PartsRightEdge[3] = [100, 350, -1]
Local $a_PartsText[3] = [@TAB & @TAB & "New Text", "Left" & @TAB & "Center" & @TAB & "Right", "Even More Text"]

;================================================================
; Example 1 - Using AutoIt Control
;================================================================
$gui = GUICreate("Status Bar Set Text", 500, -1, -1, -1, $WS_SIZEBOX)

$StatusBar1 = _GUICtrlStatusBarCreate($gui, $a_PartsRightEdge, $a_PartsText)
_GUICtrlStatusBarSetText($StatusBar1, @TAB & "Text has been set", 1)

GUISetState(@SW_SHOW)


While 1
    $msg = GUIGetMsg()
    Select
        Case $msg = $GUI_EVENT_RESIZED
            _GUICtrlStatusBarResize($StatusBar1)
        Case $msg = $GUI_EVENT_CLOSE
            ExitLoop
        Case Else
            ;;;;;
    EndSelect
   
WEnd
GUIDelete()

;================================================================
; Example 2 - External Control
;================================================================
Opt("WinTitleMatchMode", 4)
Local $h_win = WinGetHandle("classname=SciTEWindow")
Local $h_status = ControlGetHandle($h_win, "", "msctls_statusbar321")
Local $s_text = _GUICtrlStatusBarGetText($h_status)
_GUICtrlStatusBarSetText($h_status, "Text has been set")
Sleep(5000)
_GUICtrlStatusBarSetText($h_status, $s_text)